
$('#applybutton').on('click',function(){

    alert("点击了")

    let name = $("#name").val()
    let gender = $("#gender").val()
    let age = $("#age").val()
    let idnumber = $("#idnumber").val()
    let unit = $("#unit").val()
    let group = $("#group").val()
    let team = $("#team").val()
    let remark = $("#remark").val()
    let member = $("#member").val()
    let event = $("#event").val()

    if (name == '' || gender == '' || age == '' || idnumber == '' || unit == '' || group == '' || team == '' || remark == '' || member == '' || event == '') {
        alert("请填写完整信息")
    }
    else
        {
        update_apply_data()

    }

})

function update_apply_data() {

    let name = $("#name").val()
    let gender = $("#gender").val()
    let age = $("#age").val()
    let idnumber = $("#idnumber").val()
    let unit = $("#unit").val()
    let group = $("#group").val()
    let team = $("#team").val()
    let remark = $("#remark").val()
    let member = $("#member").val()
    let event = $("#event").val()



    //获取所有影响的参数
    console.log("name", name)


    $("#top").empty();
    //$.get('module/mod-auto-creat-package.php?number='+number+'&type='+type+'&bulk='+bulk,null,function (msg) {


$.ajax({
    url: 'index.php?action=applying&ai_name=' + name + '&ai_gender=' + gender + '&ai_age=' + age + '&ai_idnumber=' + idnumber + '&ai_unit=' + unit + '&ai_groups=' + group + '&ai_team=' + team + '&ai_remark=' + remark + '&ai_member_nid=' + member + '&ai_event_nid=' + event+ '&member=' + member + '&event=' + event,
    type: 'GET',

    success: function (msg) {
        msg = $.trim(msg);
        $("#top").empty();
        $("#top").append(msg);
        console.log("获得的页面结果是",msg);
    },
    error: function (jqXHR, textStatus, errorThrown) {
        // 输出错误提示信息
        $("#top").empty();
        $("#top").append('抱歉，获取内容失败，请稍后再试或联系管理员。错误详情：' + textStatus + ', ' + errorThrown);
        console.error('Ajax 请求失败:', textStatus, ', Error:', errorThrown);
    }
});


}


